%% Settings for the conditional Kiley decompositions
sampleStru.dataVec = (sampleStru.start:.25:sampleStru.finish)';
%% I.i) Define What the decomposition will be
% Possible transformations 
% In all cases the constant is added back, except for *cumsum*
%
% *none*      No transformation 
% *annualize* Multiply by 4 
% *cumsum*    Decompose the cummulative sum (constant excluded) 
% *average*   Obtain an average

histStru.report     =  {'yobs (dy)', 'cobs (dc)','iobs (di)','Hours','AvInfObs',...
    'FFR','LEPRIVA_Core','LS_Core','JCXFEBM_LD100','JCMXFEM_LD100','PCUSLFEN_LD100SA'};

histStru.transformation={'cumsum','cumsum','cumsum','none','none','none','none','annualize','annualize','annualize','annualize','annualize'};

histStru.graphNames    = {'GDP Growth', 'Consumption Growth', 'Investment Growth', 'Hours' ...
    'Average Inflation', 'FFR', 'Real Wages',  'Employment Cost Index', ... 
    'PCE Less Food Energy' 'Market-Based PCE Less Food Energy', 'CPI Less Food Energy'};

histStru.position = cellposition(histStru.report,names.states);
histStru.constants = model.CC(histStru.position,end);
% Jumping point, with full state
histStru.jumpDate=2010;
% Date at which to decompose
histStru.targetDate=2013;

% Flags
histStru.flags.flagPlotStates = 1; 
%% I.ii) States
% selected states to plot for decomps 
stateStruct.report = {'yobs (dy)', 'cobs (dc)','iobs (di)','Hours','AvInfObs','FFR',...
    'LEPRIVA_Core','LS_Core','JCXFEBM_LD100','JCMXFEM_LD100','PCUSLFEN_LD100SA'}; 

stateStruct.names.graphs= {'GDP Growth', 'Consumption Growth', 'Investment Growth', 'Hours' ...
    'Average Inflation', 'FFR', 'Real Wages',  'Employment Cost Index', ... 
    'PCE Less Food Energy' 'Market-Based PCE Less Food Energy', 'CPI Less Food Energy'};

stateStruct.graphs.NRow=4;
stateStruct.graphs.NCols=1;

stateStruct.startDate=2007.75;
stateStruct.endDate  =2013.00;


flagPlotStates=1; % 1 to plot state and innovation decomps

%% II. Settings for Shock Decompositions  
%% Groups of shocks to decompose 
%(will need to be adjusted if we ever have more than one group)

histStru.groupnames{1} = {'Demand','Supply','Policy','Residual'};
groupStruct{1}.g1  = {'Government Spending','Labor Disutility','Risk Premium'};
groupStruct{1}.g2 = {'Investment Shock','Price Markup','Wage Markup','Permanent Neutral','ISTS'};
groupStruct{1}.g3 = {'Inflation Drift','Factor A - Current Policy Factor','Factor B - Future Policy Factor'};

histStru.shocksReport = struct2array(groupStruct{1}); %selected innovations to plot, currently set to all 
